/*
 * @Copyright: 2016 www.yyfax.com Inc. All rights reserved.
 */
package com.jaws.core.compatible.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 币种类型
 * 如果枚举都转移到数据库了,则从数据库加载出来后,主动设置到values里面.
 * 
 * @author buyi
 * @date 2017-04-12 11:56:16
 * @since v1.0.0
 */
public enum CurrencyEnum {

	/** 人民币 */
	RMB("1", "人民币");
	private String value;
	private String remark;

	private CurrencyEnum(String value, String remark) {
		this.value = value;
		this.remark = remark;
	}

	public String getValue() {
		return value;
	}

	public String getRemark() {
		return remark;
	}

	public boolean isValue(String value) {
		return getValue().equals(value);
	}

	public static final CurrencyEnum fromValue(String value) {
		for (CurrencyEnum e : CurrencyEnum.values()) {
			if (StringUtils.equals(value, e.getValue())) {
				return e;
			}
		}
		return null;

	}
}
